package models.Models;

import models.SystemModels.ShopRecharge;
import models.interfaces.Systems;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2018-08-04.
 */
public class ShopRechargeViewModels {

    public Long Id;

    public double  price;

    public String  user;

    public double  Total_balance;

    public String time;

    public double balance;

    public String  type;

    public String  Odd_Numbers;

    static Systems system = new models.System.Systems.Systems();
    public static  List<ShopRechargeViewModels> ShopRechargeViewModelsList(){
        List<ShopRechargeViewModels> shopRechargeViewModelsList= new ArrayList<ShopRechargeViewModels>();
        List<ShopRecharge> list =ShopRecharge.findAll();
        for (ShopRecharge item:list) {
            ShopRechargeViewModels shopre = new ShopRechargeViewModels();
            shopre.Id= item.Id;
            Date date = new Date(item.time);
            shopre.time= system.date(date);
            shopre.price = item.price;
            shopre.Total_balance =item.Total_balance;
            shopre.balance = item.balance;
            shopre.type =item.type;
            shopre.Odd_Numbers = item.Odd_Numbers;
            shopre.user=item.user;
            shopRechargeViewModelsList.add(shopre);
        }
        return shopRechargeViewModelsList;
    }
}
